package com.zx.idc.backend.gui.ins;


import com.baomidou.mybatisplus.plugins.Page;
import com.zx.idc.backend.gui.common.BaseApi;
import com.zx.idc.backend.gui.common.Result;
import com.zx.idc.ds.ins.service.IInsFileService;
import com.zx.idc.ds.ins.vo.InsFileVo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 指令文件 前端控制器
 * </p>
 *
 * @author rxliuli
 * @since 2019-03-27
 */
@RestController
@RequestMapping("/api/insFile")
public class InsFileController extends BaseApi {

    @Autowired
    private IInsFileService iInsFileService;

    @GetMapping("/query-page")
    @RequiresPermissions("regulatory-directive:ins-file")
    public Result<Page<InsFileVo>> queryPage(Page<InsFileVo> page, InsFileVo insFileVo) {
        return success(iInsFileService.queryPage(page, insFileVo));
    }

    @PostMapping("/delete/batch")
    @RequiresPermissions("regulatory-directive:ins-file:edit")
    public Result<Boolean> deleteAll(@RequestBody List<String> ids) {
        return build(iInsFileService.deleteBatchIds(ids));
    }
}

